from urllib import request

import re
from bs4 import BeautifulSoup
url = "http://book.sina.com.cn/"
head = {}
head['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36'
req = request.Request(url, headers=head)
response = request.urlopen(req)
soup = BeautifulSoup(response,'html.parser', from_encoding="utf-8")

links = soup.find_all('a', href=re.compile(r"http://vip.book.sina.com.cn/weibobook/book/\d+\.html"))
for link in links:
    print('11')
    print(link['href'])